package com.example.qihuibao.dao

import androidx.room.*

@Dao
interface UserInfoDao {
    @Query("SELECT * FROM user_info WHERE phone IN (:field_phone)")
    fun queryInPhone(field_phone: String): List<UserInfo>?

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun save(userInfo: UserInfo) : Long

//    @Insert
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun saveList(users: List<UserInfo>) : List<Long>?

    @Query("SELECT * FROM user_info")
    fun queryAll(): List<UserInfo>?

    @Delete
    fun delete(userInfo: UserInfo)

    @Query("DELETE FROM user_info")
    fun deleteAll()
}